package com.atguigu.dwm.model.controller;

import com.atguigu.dwm.common.bean.Result;
import com.atguigu.dwm.model.bean.DmTableDataInfo;
import com.atguigu.dwm.model.service.DmTableDataInfoService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 数据信息表 前端控制器
 * </p>
 *
 * @author zhangchen
 * @since 2024-07-05
 */
@RestController
@RequestMapping("/data-model/datainfo")
public class DmTableDataInfoController {

    @Autowired
    DmTableDataInfoService dmTableDataInfoService;
    @GetMapping("/detail/{tableId}")
    public Result getDetail(@PathVariable("tableId") Long tableId) {
        DmTableDataInfo tableDataInfo
                = dmTableDataInfoService.getOne(new QueryWrapper<DmTableDataInfo>().eq("table_id", tableId));


        return Result.ok(tableDataInfo);
    }

}
